import request from "./request";

/* 
area: 地区,可选值为全部,内地,港台,欧美,日本,韩国,不填则为全部 type: 类型,可选值为全部,官方版,原生,现场版,网易出品,不填则为全部
order: 排序,可选值为上升最快,最热,最新,不填则为上升最快
limit: 取出数量 , 默认为 30
offset: 偏移数量 , 用于分页 , 如 :( 页数 -1)*50, 其中 50 为 limit 的值 , 默认 为 0
*/
// 获取全部mv
export const reqGetAllMv = () => {
  return request({
    method: "GET",
    url: "/mv/all",
  });
};
// 按类别获取mv类表
export const reqGetMvByCate = (
  areaCheck = "全部",
  typeCheck = "全部",
  orderCheck = "上升最快",
  offset
) => {
  return request({
    method: "GET",
    url: `/mv/all?area=${areaCheck}&type=${typeCheck}&order=${orderCheck}&offset=${offset}`,
  });
};
// 获取mv视频播放Url
export const reqGetMvPlayUrl = (id) => {
  return request({
    method: "GET",
    url: `mv/url?id=${id}`,
  });
};
// 获取mv视频详情
export const reqGetMvDetail = (id) => {
  return request({
    method: "GET",
    url: `/mv/detail?mvid=${id}`,
  });
};
// 获取mv评论数据
export const reqGetMvComment = ({ id, limit, offset, before, timestamp }) => {
  return request({
    method: "GET",
    url: `comment/mv?id=${id}&limit=${limit}&offset=${offset}&before=${before}&timestamp=${timestamp}`,
  });
};
// 获取相似mv
export const reqGetSimiMv = (id) => {
  return request({
    method: "GET",
    url: `/simi/mv?mvid=${id}`,
  });
};
// 发送评论
export const reqCommitComment = ({ t, type, id, content, commentId }) => {
  return request({
    method: "GET",
    url: `/comment?t=${t}&type=${type}&id=${id}&content=${content}&commentId=${commentId}`,
  });
};
// 给评论点赞
export const reqCommentPoint = ({ id, cid, t, type }) => {
  return request({
    method: "GET",
    url: `/comment/like?id=${id}&cid=${cid}&t=${t}&type=${type}`,
  });
};
